home
***
CD-ROM
|
disk
|
FTP
|
other
***
search
/
The CICA Windows Explosion!
/
The CICA Windows Explosion! - Disc 2.iso
/
programr
/
rsxwdk2s.zip
/
RSXWDK
/
LIBSRC
/
WINIO
/
ARGCARGV.C
next >
Wrap
C/C++ Source or Header
|
1994-12-21
|
1KB
|
64 lines
/*
argcargv.c -- see MSJ, May 1991, pp. 135-136
*/
#define NOGDI
#define NOUSER
#define NOKERNEL
#define STRICT
#include <windows.h>
#include <stdlib.h>
#include <string.h>
#include <sys/doscalls.h>
#include "winio.h"
#define argc __argc
#define argv __argv
extern int __argc;
extern char **__argv;
extern int winio_main(int argc, char **argv, char **envp);
int winio_read(int handle, void *buf, int size)
{
int i;
char *b = buf;
*b = 0;
winio_gets(buf);
i = strlen(buf);
b[i++]='\n';
return i;
}
void winio_addchars(void *, unsigned);
int winio_write(int handle, void *buf, int size)
{
winio_addchars(buf, size);
return size;
}
HINSTANCE _hinst;
HINSTANCE _hprevinst;
LPCSTR _lpcmdline;
int _ncmdshow;
INT PASCAL WinMain(HINSTANCE hInstance, HINSTANCE hPrevInstance,
LPSTR lpCmdLine, INT nCmdShow)
{
_hinst = hInstance;
_hprevinst = hPrevInstance;
_lpcmdline = lpCmdLine;
_ncmdshow = nCmdShow;
if (! winio_init(hInstance, hPrevInstance, nCmdShow, 0))
return 1;
_console_read = winio_read;
_console_write = winio_write;
return winio_main(argc, argv, environ);
}